package org.apache.ibatis.ztest.proxy;

import java.lang.reflect.Proxy;

/**
 * @author wangxinyuchuan
 * @version Main.java v1.0 2023/12/29 10:38 wangxinyuchuan Exp $
 */
public class Main {
  public static void main(String[] args) {
    SaveMoney mySaveMoney = new MySaveMoneyImpl();
    SaveMoney proxy = (SaveMoney)Proxy.newProxyInstance(mySaveMoney.getClass().getClassLoader(), mySaveMoney.getClass().getInterfaces(),
                                      new SaveMoneyProxy(mySaveMoney));
    proxy.saveMoney(100);
  }
}
